<div id="logPage">
    <div class="post">
        <h2 class="title">System Log</h2>
        <div class="entry">     
            <input type="button" value="Search" onclick="show('#searchlogs')"/>
            <input type="button" value="Clear Search" onclick="clearSearch()"/>
            <img src="<?= base_url(); ?>images/loading.gif" alt="Loading.." style="display: none;" id="loading"/>
            <div id="logs_result" class="info">
            </div>
            <script type="text/javascript">
                function searchLog(){
                    $("#loading").show();
                    field=document.getElementById("searchlogsForm").field.value;
                    search=document.getElementById("searchlogsForm").search.value;
                    $("#logPage").load("<?= base_url(); ?>index.php?/admin_settings/log/"+field+"/"+search);
                }
                function clearSearch(){
                    $("#loading").show();
                    $("#logPage").load("<?= base_url(); ?>index.php?/admin_settings/log/");
                }


                $('a').click(function() {
                    if(this.href.indexOf("admin_settings/log", 0)>=0){
                        $("#logPage").load(this.href);
                        return false;
                    }
                    return true;
                });
            </script>

            <div id="searchlogs" style="display: none;margin-bottom: 10px;">
                <form id="searchlogsForm">
                    <table>
                        <tr class="darker"><td class="half">Select search criteria</td>
                            <td><select name="field">
                                    <option value='all' >All</option>
                                    <option value='action'>Action</option>
                                    <option value='type'>Type</option>
                                    <option value='description'>Description</option>
                                    <option value='user'>User</option>
                                </select></td>
                            <td><input type="text" name="search" class="wide"  value="<?php echo set_value('search'); ?>" /></td>
                        </tr>

                        <tr><td colspan="2" style="text-align: right">
                                <input type="button" value="Submit" onclick="searchLog()" />
                                <input type="button" value="Cancel" onclick="hide('#searchlogs')"/>
                            </td></tr>

                    </table>
                </form>
            </div>
            <div id="all_log">
                <?= $pagina ?>
                <?= $tablet ?>
                <?= $pagina ?>
            </div>
        </div>
    </div>
</div>